import startPanel from "./startPanel";
import { util } from "./util";
import bgManager from "./bgManager";
import uiManager from "./uiManager";
import failPanel from "./failPanel";

const {ccclass, property} = cc._decorator;

@ccclass
export default class gameManager extends cc.Component {

    @property(startPanel)
    startPanel:startPanel = null;
    @property(bgManager)
    bgManager:bgManager = null;
    @property(uiManager)
    uiManager:uiManager = null;
    @property(failPanel)
    failPanel:failPanel = null;


    public isStart:boolean = false

    onLoad () {
        util.resize();
        cc.director.getCollisionManager().enabled = true;
        this.startPanel.init(this);
        this.bgManager.init(this);
        this.uiManager.init(this);
        
    }

    startGame(){
        if(this.isStart){
            this.uiManager.initScene()
        }
    }

    failGame(){
        this.failPanel.init()
    }

}
